<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class="middle myclear">
	<div class="pad10">
		
		<h2 class="marbottom10 martop10">
			Danh sách Webmaster subcribe
		</h2>
		<hr/>
		
		<a class="float-right">
			<img onclick="export_excel();" src="/images/excel.gif" alt="" id="excel" class="float-left" style="border-left:1px solid #c8c8c8;">
		</a>
		<br/>
		<div class="dashboard-box myclear martop10">
			
			<table class="tbl-list" width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td class="td-label bold text-center ver-middle" width="80">
						#
					</td>
					
					
					<td class="td-label bold ver-middle">
						Website
					</td>
					
					
					<td class="td-label bold ver-middle">
						Website Admin
					</td>
					
					<td class="td-label bold  text-center ver-middle">
						Email
					</td>
					
					<td class="td-label bold text-center ver-middle">
                        Phone
					</td>
					
					<td class="td-label bold text-center ver-middle" width="120">
                        Created time
					</td>
				</tr>
				
				<?php
				foreach($list as $item)
				{
				?>
					<tr>
						<td class="text-center pad5">
							<?php  echo $item['webmaster_id']; ?>
						</td>
						
						<td class="pad5">
							<?php echo $item['site_url']; ?>
						</td>
						
						<td class="pad5">
	                        <?php echo $item['site_admin']; ?>
						</td>
						
						<td class="text-center pad5">
	                        <?php echo $item['email']; ?>
						</td>
						
						<td class="text-center pad5">
	                        <?php echo $item['phone']; ?>
						</td>
						
						<td class="text-center pad5">
	                        <?php echo ($item['create_time'] != '') ? date('H:i:s d-m-Y', strtotime($item['create_time'])) : ''; ?>
						</td>
						
					</tr>
				<?php
				}
				?>
			</table>
			
			<!-- paging -->
			<?php
			if($iCount > 0)
			{
			?>
				<table width="100%" cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td class="pad10 ver-middle">
							Trang
							&nbsp;
							<?php echo $cPage;?>
							/
							<?php echo $pCount;?>
						</td>
						<td class="text-right pad10 ver-middle">
							<div class="paging clear">
								<div class="paging-inner float-right">
									<?php
									if($cPage > 1)
									{
										?>
										<a href="<?php echo site_url("subcribe/webmaster/?cpage=" . ($cPage - 1));?>">
											Trang trước
										</a>
										<?php
									}
									
									foreach($lstPaging as $artPage)
									{
										if($artPage > 0)
										{
									?>
										<a <?php echo ($artPage == $cPage) ? 'class="curr"' : '';?> href="<?php echo site_url("subcribe/webmaster/?cpage=$artPage");?>">
											<?php echo $artPage;?>
										</a>
									<?php
										}
									}
									
									if($cPage < $pCount)
									{
										?>
										<a href="<?php echo site_url("subcribe/webmaster/?cpage=" . ($cPage + 1));?>">
											Trang sau
										</a>
										<?php
									}
									?>
									
								</div>
							</div>
						</td>
					</tr>
				</table>
			<?php
			} // end check paging
			?>
			<!-- end paging -->
			
		</div>
	</div>
</div>
<script type="text/javascript">
function export_excel()
{
  	window.location.href = '<?php echo site_url("subcribe/webmaster/?exp=excel");?>';
}
</script>